package com.gzhryc.pay.enums;

import com.gzhryc.common.config.I18nTools;

public enum BankType {

	ICBC(1,"工商银行"),
	ABOC(2,"农业银行"),
	CCB(3,"建设银行"),
	BOC(4,"中国银行"),
	BCM(5,"交通银行"),
	CMB(6,"招商银行"),
	PSBC(7,"邮政储蓄银行"),
	CMBC(8,"民生银行"),
	CITIC(9,"中信银行"),
	CIB(10,"兴业银行"),
	CEB(11,"光大银行"),
	GDB(12,"广发银行"),
	HXB(13,"华夏银行"),
	BOB(14,"北京银行"),
	SHPD(15,"上海浦东发展银行"),
	RMYC(16,"人民银行"),
	ZSYC(17,"浙商银行"),
	OTHER(18,"其他");
	
	private Integer index;
	private String note;
	
	BankType(Integer index,String note){
		this.index = index;
		this.note = note;
	}

	public Integer index() {
		return index;
	}

	public String note() {
		I18nTools.I18n i18n = I18nTools.getCurrentI18n();
		if(i18n != null) {
			return i18n.get(this.name(),note);
		}
		return note;
	}
	
	public static BankType get(Integer index) {
		BankType[] temp = BankType.values();
		for(int i=0;i<temp.length;i++){
			BankType item = temp[i];
			if(item.index.equals(index)){
				return item;
			}
		}
		return null;
	}
	
	public static String note(Integer index){
		BankType[] temp = BankType.values();
		for(int i=0;i<temp.length;i++){
			BankType item = temp[i];
			if(item.index.equals(index)){
				return item.note();
			}
		}
		return null;
	}
}
